Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sp-api-sdk/auth

Package Overview
Dependencies
Maintainers
2
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sp-api-sdk/auth

Auth library for helping authentication with Selling Partner API

  • 0.3.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
282
decreased by-28.79%
Maintainers
2
Weekly downloads
 
Created
Source

@sp-api-sdk/auth

Package for simplifying authentication with Selling Partner API

Installing

  • yarn add @sp-api-sdk/auth
  • npm install @sp-api-sdk/auth

Usage

With Security Token Service :

import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'

const auth = new SellingPartnerApiAuth({
  clientId: '',
  clientSecret: '',
  refreshToken: 'Atzr|...',
  accessKeyId: '',
  secretAccessKey,
  role: {
    arn: roleArn,
    sessionName: 'SellingPartnerAPI'
  },
})

const accessToken = await auth.accessToken.get()
const { AccessKeyId, SecretAccessKey, SessionToken } = await auth.getCredentials()

With an AWS user :

import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'

const auth = new SellingPartnerApiAuth({
  clientId: '',
  clientSecret: '',
  refreshToken: 'Atzr|...',
  accessKeyId: '',
  secretAccessKey,
  user: {
    AccessKeyId: '',
    SecretAccessKey: ''
  }
})

const accessToken = await auth.accessToken.get()
const { AccessKeyId, SecretAccessKey } = await auth.getCredentials()

Everytime you get the access token, the class will check before if the token has already been fetch or if it's still valid, if not, it will fetch it.

Same for the given credentials from Security Token Service

Keywords

FAQs

Package last updated on 29 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc